<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  
  <title>在 Archlinux 下从 AUR 装的 xmind 启动报错的问题探究 | 四叶草</title>
  
  <meta name="keywords" content="archlinux,linux">
  
  
  <meta name="description" content="一个技术宅的技术分享">
  

  
  <link rel="alternate" href="/atom.xml" title="四叶草">
  

  <meta name="HandheldFriendly" content="True" />
  <meta name="apple-mobile-web-app-capable" content="yes">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <!-- meta -->
  

  <!-- link -->
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.css" />
  
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@5.10.1/css/all.min.css">
  

  

  
    
<link rel="stylesheet" href="/style.css">

  

  <script>
    function setLoadingBarProgress(num) {
      document.getElementById('loading-bar').style.width=num+"%";
    }
  </script>

  
  
<meta name="generator" content="Hexo 4.2.1"><link rel="alternate" href="/atom.xml" title="四叶草" type="application/atom+xml">
</head>

<body>
  
  
  <header class="l_header material">
  <div id="loading-bar-wrapper">
    <div id="loading-bar" class="material"></div>
  </div>

	<div class='wrapper'>
		<div class="nav-main container container--flex">
      <a class="logo flat-box" href='/' >
        
          四叶草
        
      </a>
			<div class='menu navgation'>
				<ul class='h-list'>
          
  					
  						<li>
								<a class="nav flat-box" href="/"
                  
                  
                  id="home">
									<i class='fas fa-home fa-fw'></i>&nbsp;主页
								</a>
							</li>
      			
  						<li>
								<a class="nav flat-box" href="/categories/"
                  
                    rel="nofollow"
                  
                  
                  id="categories">
									<i class='fas fa-folder-open fa-fw'></i>&nbsp;分类
								</a>
							</li>
      			
  						<li>
								<a class="nav flat-box" href="/tags/"
                  
                    rel="nofollow"
                  
                  
                  id="tags">
									<i class='fas fa-hashtag fa-fw'></i>&nbsp;标签
								</a>
							</li>
      			
  						<li>
								<a class="nav flat-box" href="/archives/"
                  
                    rel="nofollow"
                  
                  
                  id="archives">
									<i class='fas fa-archive fa-fw'></i>&nbsp;归档
								</a>
							</li>
      			
      		
				</ul>
			</div>

			
				<div class="m_search">
					<form name="searchform" class="form u-search-form">
						<input type="text" class="input u-search-input" placeholder="搜索" />
						<i class="icon fas fa-search fa-fw"></i>
					</form>
				</div>
			
			<ul class='switcher h-list'>
				
					<li class='s-search'><a class="fas fa-search fa-fw" href='javascript:void(0)'></a></li>
				
				<li class='s-menu'><a class="fas fa-bars fa-fw" href='javascript:void(0)'></a></li>
			</ul>
		</div>

		<div class='nav-sub container container--flex'>
			<a class="logo flat-box"></a>
			<ul class='switcher h-list'>
				<li class='s-comment'><a class="flat-btn fas fa-comments fa-fw" href='javascript:void(0)'></a></li>
        
          <li class='s-toc'><a class="flat-btn fas fa-list fa-fw" href='javascript:void(0)'></a></li>
        
			</ul>
		</div>
	</div>
</header>
	<aside class="menu-phone">
    <header>
		<nav class="menu navgation">
      <ul>
        
          
            <li>
							<a class="nav flat-box" href="/"
                
                
                id="home">
								<i class='fas fa-clock fa-fw'></i>&nbsp;近期
							</a>
            </li>
          
            <li>
							<a class="nav flat-box" href="/categories/"
                
                  rel="nofollow"
                
                
                id="categories">
								<i class='fas fa-folder-open fa-fw'></i>&nbsp;分类
							</a>
            </li>
          
            <li>
							<a class="nav flat-box" href="/tags/"
                
                  rel="nofollow"
                
                
                id="tags">
								<i class='fas fa-hashtag fa-fw'></i>&nbsp;标签
							</a>
            </li>
          
            <li>
							<a class="nav flat-box" href="/archives/"
                
                  rel="nofollow"
                
                
                id="archives">
								<i class='fas fa-archive fa-fw'></i>&nbsp;归档
							</a>
            </li>
          
            <li>
							<a class="nav flat-box" href="/about/"
                
                  rel="nofollow"
                
                
                id="about">
								<i class='fas fa-info-circle fa-fw'></i>&nbsp;关于
							</a>
            </li>
          
       
      </ul>
		</nav>
    </header>
	</aside>
<script>setLoadingBarProgress(40);</script>



  <div class="l_body nocover">
    <div class='body-wrapper'>
      <div class='l_main'>
  

  <article id="post" class="post white-box article-type-post" itemscope itemprop="blogPost">
    


  <section class='meta'>
    
    
    <div class="meta" id="header-meta">
      
        
  
    <h1 class="title">
      <a href="/learn/xmind-error/">
        在 Archlinux 下从 AUR 装的 xmind 启动报错的问题探究
      </a>
    </h1>
  


      
      <div class='new-meta-box'>
        
          
        
          
            
  <div class='new-meta-item author'>
    
      <a href="/about" rel="nofollow">
        
          <i class="fas fa-user" aria-hidden="true"></i>
        
        <p>四叶草🍀</p>
      </a>
    
  </div>


          
        
          
            <div class="new-meta-item date">
  <a class='notlink'>
    <i class="fas fa-calendar-alt" aria-hidden="true"></i>
    <p>2019-04-18</p>
  </a>
</div>

          
        
          
            
  
  <div class='new-meta-item category'>
    <a href='/categories/%E6%8E%A2%E7%A9%B6%E5%AD%A6%E4%B9%A0/' rel="nofollow">
      <i class="fas fa-folder-open" aria-hidden="true"></i>
      <p>探究学习</p>
    </a>
  </div>


          
        
          
            

  <div class="new-meta-item markdown">
    
    
      <a href="https://github.com/fkxxyz/fkxxyz-blog-src/blob/master/source/_posts/learn/xmind-error.md" target="_blank" rel="nofollow noopener">
    
      <i class="fab fa-markdown"></i>
      <p>md源文档</p>
    </a>
  </div>



          
        
          
            

  <div class="new-meta-item download">
    
    
      <a href="https://github.com/fkxxyz/fkxxyz-blog-src/raw/master/source/_posts/learn/xmind-error.md" target="_blank" rel="nofollow noopener">
    
      <i class="fas fa-download"></i>
      <p>下载本文</p>
    </a>
  </div>



          
        
          
            
  
    <div class="new-meta-item browse busuanzi">
      <a class='notlink'>
        <i class="fas fa-eye" aria-hidden="true"></i>
        <p>
          <span id="busuanzi_value_page_pv">
            <i class="fas fa-spinner fa-spin fa-fw" aria-hidden="true"></i>
          </span>
        </p>
      </a>
    </div>
  


          
        
          
            

          
        
      </div>
      
        <hr>
      
    </div>
  </section>


    <section class="article typo">
      <div class="article-entry" itemprop="articleBody">
        <p>电脑版的思维导图软件，我还是最钟爱 xmind，然而在 archlinux 下从 AUR 构建 xmind 直接启动之后报错。</p>
<a id="more"></a>

<h2 id="问题描述"><a href="#问题描述" class="headerlink" title="问题描述"></a>问题描述</h2><ol>
<li><p>安装完之后，直接点击图标直接启动，弹出以下对话框。</p>
<p><img src="/img/xmind-error.png" alt="xmind-error"></p>
</li>
<li><p>在安装 XMind 时，输出的结果</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br></pre></td><td class="code"><pre><span class="line">正在加载软件包...</span><br><span class="line">正在解析依赖关系...</span><br><span class="line">正在查找软件包冲突...</span><br><span class="line"></span><br><span class="line">软件包 (1) xmind-3.7.8+8update8-1</span><br><span class="line"></span><br><span class="line">全部安装大小：  125.02 MiB</span><br><span class="line"></span><br><span class="line">:: 进行安装吗？ [Y&#x2F;n] </span><br><span class="line">(1&#x2F;1) 正在检查密钥环里的密钥                        [###########################] 100%</span><br><span class="line">(1&#x2F;1) 正在检查软件包完整性                          [###########################] 100%</span><br><span class="line">(1&#x2F;1) 正在加载软件包文件                            [###########################] 100%</span><br><span class="line">(1&#x2F;1) 正在检查文件冲突                              [###########################] 100%</span><br><span class="line">(1&#x2F;1) 正在检查可用存储空间                          [###########################] 100%</span><br><span class="line">:: 正在处理软件包的变化...</span><br><span class="line">(1&#x2F;1) 正在安装 xmind                                [###########################] 100%</span><br><span class="line">If XMind crashed on start, trying delete ~&#x2F;.xmind</span><br><span class="line"></span><br><span class="line">If you want to change gtk version or java version, please edit PKGBUILD and rebuild the package. Or edit &#x2F;usr&#x2F;share&#x2F;xmind&#x2F;XMind&#x2F;XMind.ini, change number to your gtk version after &quot;--launcher.GTK_version&quot;, and add&#x2F;delete &quot;--add-modules&#x3D;java.se.ee&quot; at the end of file if you use java 10&#x2F;8.</span><br><span class="line">xmind 的可选依赖</span><br><span class="line">    gtk2: gtk2 or gtk3 must install one [已安装]</span><br><span class="line">    gtk3: gtk2 or gtk3 must install one [已安装]</span><br><span class="line">    lame: needed for the feature audio notes [已安装]</span><br><span class="line">:: 正在运行事务后钩子函数...</span><br><span class="line">(1&#x2F;6) Arming ConditionNeedsUpdate...</span><br><span class="line">(2&#x2F;6) Updating fontconfig cache...</span><br><span class="line">(3&#x2F;6) Updating 32-bit fontconfig cache...</span><br><span class="line">(4&#x2F;6) Updating the desktop file MIME type cache...</span><br><span class="line">(5&#x2F;6) Updating the MIME type database...</span><br><span class="line">(6&#x2F;6) Updating X fontdir indices...</span><br></pre></td></tr></table></figure>




</li>
</ol>
<h2 id="问题探究"><a href="#问题探究" class="headerlink" title="问题探究"></a>问题探究</h2><h3 id="常规思考"><a href="#常规思考" class="headerlink" title="常规思考"></a>常规思考</h3><p>由打包者提示的信息，基本可以猜测，是 java 运行环境的问题，以及启动参数 –add-modules=java.se.ee 的问题。</p>
<p>那么尝试从命令行启动，看看有没有报错信息吧，先找到对应的命令</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">pacman -Ql xmind | grep desktop</span><br><span class="line"><span class="meta">#</span><span class="bash"> 输出 xmind /usr/share/applications/xmind.desktop</span></span><br><span class="line"></span><br><span class="line">cat /usr/share/applications/xmind.desktop | grep Exec</span><br><span class="line"><span class="meta">#</span><span class="bash"> 输出 Exec=XMind %F</span></span><br></pre></td></tr></table></figure>

<p>得知启动命令是 XMind，那么直接执行 XMind 试试之后，得到如下报错，同时弹出上面那错误对话框。</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">Unrecognized option: --add-modules&#x3D;java.se.ee</span><br><span class="line">Error: Could not create the Java Virtual Machine.</span><br><span class="line">Error: A fatal exception has occurred. Program will exit.</span><br></pre></td></tr></table></figure>

<p>提示很明显，不识别的参数 –add-modules=java.se.ee，结合上面安装的时候给的信息，去编辑 /usr/share/xmind/XMind/XMind.ini，发现里面有 –add-modules=java.se.ee 这一行，把这一行删掉。</p>
<p>然后再输入 XMind ，发现启动成功！</p>
<h3 id="深入探究"><a href="#深入探究" class="headerlink" title="深入探究"></a>深入探究</h3><p>抱着追根究低的态度继续思考，–add-modules=java.se.ee 有什么意义呢为什么会被加上？再细细读打包者给出的信息的最后一句话</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">and add&#x2F;delete &quot;--add-modules&#x3D;java.se.ee&quot; at the end of file if you use java 10&#x2F;8.</span><br></pre></td></tr></table></figure>

<p>很容易猜出，java 10 可能支持 –add-modules=java.se.ee，而 java 8 不支持。</p>
<p>看看当前的系统中的 java 版本吧</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">java -version</span><br></pre></td></tr></table></figure>

<p>果然是 1.8 版本。</p>
<p>那么我们装个 java 10 试试。</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">sudo pacman -S java-runtime&#x3D;10</span><br></pre></td></tr></table></figure>

<p>然后用 java 切换脚本（详见 <a href="https://wiki.archlinux.org/index.php/Java_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)" target="_blank" rel="noopener">java的archwiki</a>），切换成 java 10</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line"># 列出系统中所有 java 环境</span><br><span class="line">archlinux-java status</span><br><span class="line"></span><br><span class="line"># 切换 java 10 为默认环境</span><br><span class="line">sudo archlinux-java set java-10-openjdk</span><br><span class="line"></span><br><span class="line"># 查看切换结果</span><br><span class="line">archlinux-java status</span><br><span class="line">java -version</span><br></pre></td></tr></table></figure>

<p>然后再试试启动 XMind，发现启动不了了，如下弹窗报错</p>
<p><img src="/img/xmind-error1.png" alt="xmind-error1"></p>
<p>去看这个日志，发现一大堆，因为没学过太多 java，所以看不懂也并不想看。</p>
<p>直接把 –add-modules=java.se.ee 加回 /usr/share/xmind/XMind/XMind.ini 再试试启动，发现启动成功。</p>
<p>也就是验证了前面猜测是正确的：</p>
<ol>
<li>在 java 8 的环境下，不能有 –add-modules=java.se.ee</li>
<li>在 java 10 的环境下，必须有 –add-modules=java.se.ee</li>
</ol>
<h2 id="修改-PKGBUILD-重新打包"><a href="#修改-PKGBUILD-重新打包" class="headerlink" title="修改 PKGBUILD 重新打包"></a>修改 PKGBUILD 重新打包</h2><p>我再打开这个包的 PKGBUILD 一看，发现有 JAVA_VERSION=10 语句，然后 package 函数里有 if [[ “$JAVA_VERSION” != “8” ]]; then 来决定是否往里写 –add-modules=java.se.ee</p>
<p>但是就算在这里改了 JAVA_VERSION 这个变量，那谁知道用户的机子里默认的是 java8 还是 java10 呢？这里 JAVA_VERSION 设置的是 10 ，而大多数用户默认肯定是 8，这么一来，岂不是对新手很不友好？</p>
<p>有没有更好的打包方案呢，有，我觉得可以这样做：</p>
<ol>
<li><p>将依赖行为 depends=(‘java-runtime&gt;=8’) 改成 depends=(“java-runtime=$JAVA_VERSION”)</p>
</li>
<li><p>将启动脚本里面加上一行对应的 PATH 变量来显式指定 java 环境。</p>
<p>即在最后一行 cp ${srcdir}/XMind              ${pkgdir}/usr/bin/ 后面加</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">sed -i &#39;&#x2F;exec&#x2F;iPATH&#x3D;&#x2F;usr&#x2F;lib&#x2F;jvm&#x2F;java-&#39;&quot;$JAVA_VERSION&quot;&#39;-openjdk&#x2F;bin:$PATH&#39; $&#123;pkgdir&#125;&#x2F;usr&#x2F;bin&#x2F;XMind</span><br></pre></td></tr></table></figure>

</li>
</ol>
<p>至此，观察到里面选择 gtk2 还是 gtk3 也是同样的道理。</p>
<p>最终给出我修改后完整的 PKGBUILD</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">#</span><span class="bash"> <span class="variable">$Id</span>: PKGBUILD 184754 2016-08-01 15:30:30Z felixonmars $</span></span><br><span class="line"><span class="meta">#</span><span class="bash"> Maintainer: RemiliaForever &lt;remilia AT koumakan DOT cc&gt;</span></span><br><span class="line"><span class="meta">#</span><span class="bash"> Contributor: Felix Yan &lt;felixonmars@gmail.com&gt;</span></span><br><span class="line"><span class="meta">#</span><span class="bash"> Contributor: Christoph Drexler &lt;chrdr at gmx dot at&gt;</span></span><br><span class="line"><span class="meta">#</span><span class="bash"> Contributor: Jelle van der Waa &lt;jellevdwaa@gmail.com&gt;</span></span><br><span class="line"></span><br><span class="line"><span class="meta">#</span><span class="bash"> GTK_VERSION 2/3</span></span><br><span class="line">GTK_VERSION=3</span><br><span class="line"><span class="meta">#</span><span class="bash"> JAVA_VERSION 8/10</span></span><br><span class="line">JAVA_VERSION=10</span><br><span class="line"></span><br><span class="line">pkgname=xmind</span><br><span class="line">pkgver=3.7.8+8update8</span><br><span class="line">_filename=$pkgname-8-update8-linux</span><br><span class="line">pkgrel=1</span><br><span class="line">pkgdesc="Brainstorming and Mind Mapping Software"</span><br><span class="line">arch=('i686' 'x86_64')</span><br><span class="line">url="http://www.xmind.net"</span><br><span class="line">license=('EPL' 'LGPL')</span><br><span class="line">depends=("java-runtime=$JAVA_VERSION" "gtk$GTK_VERSION")</span><br><span class="line">optdepends=('lame: needed for the feature audio notes')</span><br><span class="line">install=xmind.install</span><br><span class="line">source=("http://www.xmind.net/xmind/downloads/$&#123;_filename&#125;.zip"</span><br><span class="line">'XMind'</span><br><span class="line">'xmind.desktop'</span><br><span class="line">'xmind.xml'</span><br><span class="line">'xmind.png'</span><br><span class="line">'xmind_file.png')</span><br><span class="line">sha512sums=('77c5c05801f3ad3c0bf5550fa20c406f64f3f5fa31321a53786ac1939053f5c4f0d0fb8ab1af0a9b574e3950342325b9c32cf2e9a11bf00a1d74d2be1df75768'</span><br><span class="line">'SKIP'</span><br><span class="line">'SKIP'</span><br><span class="line">'SKIP'</span><br><span class="line">'SKIP'</span><br><span class="line">'SKIP')</span><br><span class="line"></span><br><span class="line">package() &#123;</span><br><span class="line">    mkdir -p $&#123;pkgdir&#125;/usr/share/$&#123;pkgname&#125;</span><br><span class="line">    cp -r $&#123;srcdir&#125;/configuration   $&#123;pkgdir&#125;/usr/share/$&#123;pkgname&#125;/</span><br><span class="line">    cp -r $&#123;srcdir&#125;/features        $&#123;pkgdir&#125;/usr/share/$&#123;pkgname&#125;/</span><br><span class="line">    cp -r $&#123;srcdir&#125;/plugins         $&#123;pkgdir&#125;/usr/share/$&#123;pkgname&#125;/</span><br><span class="line">    cp $&#123;srcdir&#125;/*.xml              $&#123;pkgdir&#125;/usr/share/$&#123;pkgname&#125;/</span><br><span class="line">    mkdir -p $&#123;pkgdir&#125;/usr/share/licenses/$&#123;pkgname&#125;</span><br><span class="line">    cp $&#123;srcdir&#125;/&#123;epl-v10,lgpl-3.0&#125;.html    $&#123;pkgdir&#125;/usr/share/licenses/$&#123;pkgname&#125;/</span><br><span class="line">    cp $&#123;srcdir&#125;/xpla.txt                   $&#123;pkgdir&#125;/usr/share/licenses/$&#123;pkgname&#125;/</span><br><span class="line">    if [[ "$CARCH" == "i686" ]]; then</span><br><span class="line">        cp -r $&#123;srcdir&#125;/XMind_i386  $&#123;pkgdir&#125;/usr/share/$&#123;pkgname&#125;/XMind</span><br><span class="line">    else</span><br><span class="line">        cp -r $&#123;srcdir&#125;/XMind_amd64 $&#123;pkgdir&#125;/usr/share/$&#123;pkgname&#125;/XMind</span><br><span class="line">    fi</span><br><span class="line">    mkdir -p $&#123;pkgdir&#125;/usr/share/fonts/$&#123;pkgname&#125;</span><br><span class="line">    cp -r $&#123;srcdir&#125;/fonts           $&#123;pkgdir&#125;/usr/share/fonts/$&#123;pkgname&#125;/</span><br><span class="line">    mkdir -p $&#123;pkgdir&#125;/usr/share/applications</span><br><span class="line">    cp $&#123;srcdir&#125;/xmind.desktop      $&#123;pkgdir&#125;/usr/share/applications/</span><br><span class="line">    mkdir -p $&#123;pkgdir&#125;/usr/share/mime/packages</span><br><span class="line">    cp $&#123;srcdir&#125;/xmind.xml          $&#123;pkgdir&#125;/usr/share/mime/packages/</span><br><span class="line">    mkdir -p $&#123;pkgdir&#125;/usr/share/pixmaps</span><br><span class="line">    cp $&#123;srcdir&#125;/*.png              $&#123;pkgdir&#125;/usr/share/pixmaps/</span><br><span class="line">    # fix configuration</span><br><span class="line">    sed -i "s|^./configuration$|@user.home/.xmind/configuration|" $&#123;pkgdir&#125;/usr/share/$&#123;pkgname&#125;/XMind/XMind.ini</span><br><span class="line">    sed -i "s|^../workspace$|@user.home/.xmind/workspace|" $&#123;pkgdir&#125;/usr/share/$&#123;pkgname&#125;/XMind/XMind.ini</span><br><span class="line">    if [[ "$GTK_VERSION" != "2" ]]; then</span><br><span class="line">        sed -i "s|^2$|3|" $&#123;pkgdir&#125;/usr/share/$&#123;pkgname&#125;/XMind/XMind.ini</span><br><span class="line">    fi</span><br><span class="line">    if [[ "$JAVA_VERSION" != "8" ]]; then</span><br><span class="line">        echo "--add-modules=java.se.ee" &gt;&gt; $&#123;pkgdir&#125;/usr/share/$&#123;pkgname&#125;/XMind/XMind.ini</span><br><span class="line">    fi</span><br><span class="line">    mkdir -p $&#123;pkgdir&#125;/usr/bin</span><br><span class="line">    cp $&#123;srcdir&#125;/XMind              $&#123;pkgdir&#125;/usr/bin/</span><br><span class="line">    sed -i '/exec/iPATH=/usr/lib/jvm/java-'"$JAVA_VERSION"'-openjdk/bin:$PATH' $&#123;pkgdir&#125;/usr/bin/XMind</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<p>然后可以随意修改 GTK_VERSION 和 JAVA_VERSION 来达到目的，并且还不用额外修改任何东西，无论如何切换默认 java 版本，都不会再影响启动了。</p>
<p>重新打包测试，成功。</p>

      </div>
      
      
        <br>
        


  <section class='meta' id="footer-meta">
    <div class='new-meta-box'>
      
        
          <div class="new-meta-item date" itemprop="dateUpdated" datetime="2019-12-18T18:10:14+08:00">
  <a class='notlink'>
    <i class="fas fa-clock" aria-hidden="true"></i>
    <p>更新于 2019年12月18日</p>
  </a>
</div>

        
      
        
          
  
  <div class="new-meta-item meta-tags"><a class="tag" href="/tags/archlinux/" rel="nofollow"><i class="fas fa-tag" aria-hidden="true"></i><p>archlinux</p></a></div> <div class="new-meta-item meta-tags"><a class="tag" href="/tags/%E6%80%9D%E7%BB%B4%E5%AF%BC%E5%9B%BE/" rel="nofollow"><i class="fas fa-tag" aria-hidden="true"></i><p>思维导图</p></a></div>


        
      
        
          
  <div class="new-meta-item share -mob-share-list">
  <div class="-mob-share-list share-body">
    
      
        <a class="-mob-share-qq" title="QQ好友" rel="external nofollow noopener noreferrer"
          
          href="http://connect.qq.com/widget/shareqq/index.html?url=https://www.fkxxyz.com/learn/xmind-error/&title=在 Archlinux 下从 AUR 装的 xmind 启动报错的问题探究 | 四叶草&summary=电脑版的思维导图软件，我还是最钟爱 xmind，然而在 archlinux 下从 AUR 构建 xmind 直接启动之后报错。"
          
          >
          
            <img src="https://cdn.jsdelivr.net/gh/xaoxuu/assets@19.1.9/logo/128/qq.png">
          
        </a>
      
    
      
        <a class="-mob-share-qzone" title="QQ空间" rel="external nofollow noopener noreferrer"
          
          href="https://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url=https://www.fkxxyz.com/learn/xmind-error/&title=在 Archlinux 下从 AUR 装的 xmind 启动报错的问题探究 | 四叶草&summary=电脑版的思维导图软件，我还是最钟爱 xmind，然而在 archlinux 下从 AUR 构建 xmind 直接启动之后报错。"
          
          >
          
            <img src="https://cdn.jsdelivr.net/gh/xaoxuu/assets@19.1.9/logo/128/qzone.png">
          
        </a>
      
    
      
        <a class="-mob-share-weibo" title="微博" rel="external nofollow noopener noreferrer"
          
          href="http://service.weibo.com/share/share.php?url=https://www.fkxxyz.com/learn/xmind-error/&title=在 Archlinux 下从 AUR 装的 xmind 启动报错的问题探究 | 四叶草&summary=电脑版的思维导图软件，我还是最钟爱 xmind，然而在 archlinux 下从 AUR 构建 xmind 直接启动之后报错。"
          
          >
          
            <img src="https://cdn.jsdelivr.net/gh/xaoxuu/assets@19.1.9/logo/128/weibo.png">
          
        </a>
      
    
  </div>
</div>



        
      
    </div>
  </section>


      
      
          <div class="prev-next">
              
                  <section class="prev">
                      <span class="art-item-left">
                          <h6><i class="fas fa-chevron-left" aria-hidden="true"></i>&nbsp;上一页</h6>
                          <h4>
                              <a href="/c/nvidia/" rel="prev" title="archlinux 下 nvidia 双显卡配置--大黄蜂方案">
                                
                                    archlinux 下 nvidia 双显卡配置--大黄蜂方案
                                
                              </a>
                          </h4>
                          
                              
                              <h6 class="tags">
                                  <a class="tag" href="/tags/archlinux/"><i class="fas fa-tag fa-fw" aria-hidden="true"></i> archlinux</a> <a class="tag" href="/tags/%E5%8F%8C%E6%98%BE%E5%8D%A1%E5%88%87%E6%8D%A2/"><i class="fas fa-tag fa-fw" aria-hidden="true"></i> 双显卡切换</a>
                              </h6>
                          
                      </span>
                  </section>
              
              
                  <section class="next">
                      <span class="art-item-right" aria-hidden="true">
                          <h6>下一页&nbsp;<i class="fas fa-chevron-right" aria-hidden="true"></i></h6>
                          <h4>
                              <a href="/c/nm/" rel="prev" title="NetworkManager 网络配置速查">
                                  
                                      NetworkManager 网络配置速查
                                  
                              </a>
                          </h4>
                          
                              
                              <h6 class="tags">
                                  <a class="tag" href="/tags/archlinux/"><i class="fas fa-tag fa-fw" aria-hidden="true"></i> archlinux</a> <a class="tag" href="/tags/linux/"><i class="fas fa-tag fa-fw" aria-hidden="true"></i> linux</a>
                              </h6>
                          
                      </span>
                  </section>
              
          </div>
      
    </section>
  </article>



  <!-- 显示推荐文章和评论 -->



  






<!-- 根据页面mathjax变量决定是否加载MathJax数学公式js -->



  <script>
    window.subData = {
      title: '在 Archlinux 下从 AUR 装的 xmind 启动报错的问题探究',
      tools: true
    }
  </script>


</div>
<aside class='l_side'>
  
    
    
      
      
        
          
          
        
          
          
        
          
          
        
          
          
            
              <section class='widget grid'>
  
<header class='material'>
  <div><i class="fas fa-map-signs fa-fw" aria-hidden="true"></i>&nbsp;&nbsp;站内导航</div>
  
</header>

  <div class='content material'>
    <ul class="grid navgation">
      
        <li><a class="flat-box" title="/" href="/"
          
          
          id="home">
          
            <i class="fas fa-clock fa-fw" aria-hidden="true"></i>
          
          近期文章
        </a></li>
      
        <li><a class="flat-box" title="/archives/" href="/archives/"
          
            rel="nofollow"
          
          
          id="archives">
          
            <i class="fas fa-archive fa-fw" aria-hidden="true"></i>
          
          文章归档
        </a></li>
      
        <li><a class="flat-box" title="/about/" href="/about/"
          
            rel="nofollow"
          
          
          id="about">
          
            <i class="fas fa-info-circle fa-fw" aria-hidden="true"></i>
          
          关于小站
        </a></li>
      
    </ul>
  </div>
</section>

            
          
        
          
          
        
          
          
        
          
          
        
          
          
        
      
        
          
          
        
          
          
        
          
          
        
          
          
        
          
          
            
              
  <section class='widget category'>
    
<header class='material'>
  <div><i class="fas fa-folder-open fa-fw" aria-hidden="true"></i>&nbsp;&nbsp;文章分类</div>
  
    <a class="rightBtn"
    
      rel="nofollow"
    
    
    href="/categories/"
    title="categories/">
    <i class="fas fa-expand-arrows-alt fa-fw"></i></a>
  
</header>

    <div class='content material'>
      <ul class="entry">
        
          <li><a class="flat-box" title="/categories/%E5%8E%9F%E5%88%9B%E5%BC%80%E5%8F%91/" href="/categories/%E5%8E%9F%E5%88%9B%E5%BC%80%E5%8F%91/"><div class='name'>原创开发</div><div class='badge'>(5)</div></a></li>
        
          <li><a class="flat-box" title="/categories/%E6%8E%A2%E7%A9%B6%E5%AD%A6%E4%B9%A0/" href="/categories/%E6%8E%A2%E7%A9%B6%E5%AD%A6%E4%B9%A0/"><div class='name'>探究学习</div><div class='badge'>(6)</div></a></li>
        
          <li><a class="flat-box" title="/categories/%E6%95%99%E7%A8%8B/" href="/categories/%E6%95%99%E7%A8%8B/"><div class='name'>教程</div><div class='badge'>(7)</div></a></li>
        
          <li><a class="flat-box" title="/categories/%E8%AE%B0%E5%BD%95/" href="/categories/%E8%AE%B0%E5%BD%95/"><div class='name'>记录</div><div class='badge'>(1)</div></a></li>
        
      </ul>
    </div>
  </section>


            
          
        
          
          
        
          
          
        
          
          
        
      
        
          
          
        
          
          
        
          
          
        
          
          
        
          
          
        
          
          
            
              
  <section class='widget tagcloud'>
    
<header class='material'>
  <div><i class="fas fa-tags fa-fw" aria-hidden="true"></i>&nbsp;&nbsp;热门标签</div>
  
    <a class="rightBtn"
    
      rel="nofollow"
    
    
    href="/tags/"
    title="tags/">
    <i class="fas fa-expand-arrows-alt fa-fw"></i></a>
  
</header>

    <div class='content material'>
      <a href="/tags/archlinux/" style="font-size: 24px; color: #555">archlinux</a> <a href="/tags/fcitx/" style="font-size: 16.5px; color: #888">fcitx</a> <a href="/tags/hexo/" style="font-size: 16.5px; color: #888">hexo</a> <a href="/tags/linux/" style="font-size: 19px; color: #777">linux</a> <a href="/tags/php/" style="font-size: 14px; color: #999">php</a> <a href="/tags/python/" style="font-size: 21.5px; color: #666">python</a> <a href="/tags/rime/" style="font-size: 14px; color: #999">rime</a> <a href="/tags/sed/" style="font-size: 14px; color: #999">sed</a> <a href="/tags/shell/" style="font-size: 14px; color: #999">shell</a> <a href="/tags/wine/" style="font-size: 16.5px; color: #888">wine</a> <a href="/tags/%E4%BF%A1%E6%81%AF%E5%AE%89%E5%85%A8/" style="font-size: 16.5px; color: #888">信息安全</a> <a href="/tags/%E5%89%8D%E7%AB%AF/" style="font-size: 14px; color: #999">前端</a> <a href="/tags/%E5%8D%B3%E5%85%B4%E4%BC%B4%E5%A5%8F/" style="font-size: 14px; color: #999">即兴伴奏</a> <a href="/tags/%E5%8F%8C%E6%98%BE%E5%8D%A1%E5%88%87%E6%8D%A2/" style="font-size: 14px; color: #999">双显卡切换</a> <a href="/tags/%E5%92%8C%E5%BC%A6/" style="font-size: 14px; color: #999">和弦</a> <a href="/tags/%E6%80%9D%E7%BB%B4%E5%AF%BC%E5%9B%BE/" style="font-size: 16.5px; color: #888">思维导图</a> <a href="/tags/%E6%A1%8C%E9%9D%A2%E7%8E%AF%E5%A2%83/" style="font-size: 14px; color: #999">桌面环境</a> <a href="/tags/%E7%9A%AE%E8%82%A4/" style="font-size: 14px; color: #999">皮肤</a> <a href="/tags/%E8%BE%93%E5%85%A5%E6%B3%95/" style="font-size: 16.5px; color: #888">输入法</a> <a href="/tags/%E9%9F%B3%E4%B9%90/" style="font-size: 14px; color: #999">音乐</a>
    </div>
  </section>


            
          
        
          
          
        
          
          
        
      
        
          
          
        
          
          
        
          
          
            
              
  <section class='widget toc-wrapper'>
    
<header class='material'>
  <div><i class="fas fa-list fa-fw" aria-hidden="true"></i>&nbsp;&nbsp;本文目录</div>
  
    <!-- <div class='wrapper'><a class="s-toc rightBtn" rel="external nofollow noopener noreferrer" href="javascript:void(0)"><i class="fas fa-thumbtack fa-fw"></i></a></div> -->
  
</header>

    <div class='content material'>
      <ol class="toc"><li class="toc-item toc-level-2"><a class="toc-link" href="#问题描述"><span class="toc-text">问题描述</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#问题探究"><span class="toc-text">问题探究</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#常规思考"><span class="toc-text">常规思考</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#深入探究"><span class="toc-text">深入探究</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#修改-PKGBUILD-重新打包"><span class="toc-text">修改 PKGBUILD 重新打包</span></a></li></ol>
    </div>
  </section>


            
          
        
          
          
        
          
          
        
          
          
        
          
          
        
          
          
        
      
    

  
</aside>

<footer id="footer" class="clearfix">
  
  
    <div class="social-wrapper">
      
        
          <a href="/atom.xml"
            class="social fas fa-rss flat-btn"
            target="_blank"
            rel="external nofollow noopener noreferrer">
          </a>
        
      
        
          <a href="mailto:fkxxyz@163.com"
            class="social fas fa-envelope flat-btn"
            target="_blank"
            rel="external nofollow noopener noreferrer">
          </a>
        
      
        
          <a href="https://github.com/fkxxyz"
            class="social fab fa-github flat-btn"
            target="_blank"
            rel="external nofollow noopener noreferrer">
          </a>
        
      
        
          <a href="https://ti.qq.com/open_qq/index2.html?url=mqqapi%3a%2f%2fuserprofile%2ffriend_profile_card%3fsrc_type%3dweb%26version%3d1.0%26source%3d2%26uin%3d396519827"
            class="social fab fa-qq flat-btn"
            target="_blank"
            rel="external nofollow noopener noreferrer">
          </a>
        
      
    </div>
  
  <br>
  <div><p>博客内容遵循 <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh" target="_blank" rel="noopener">署名-非商业性使用-相同方式共享 4.0 国际 (CC BY-NC-SA 4.0) 协议</a></p>
</div>
  <div>
    本站使用
    <a href="https://xaoxuu.com/wiki/material-x/" target="_blank" class="codename">Material X</a>
    作为主题
    
      ，
      总访问量为
      <span id="busuanzi_value_site_pv"><i class="fas fa-spinner fa-spin fa-fw" aria-hidden="true"></i></span>
      次
    
    。
  </div>
</footer>
<script>setLoadingBarProgress(80);</script>


      <script>setLoadingBarProgress(60);</script>
    </div>
    <a class="s-top fas fa-arrow-up fa-fw" href='javascript:void(0)'></a>
  </div>
  <script src="https://cdn.jsdelivr.net/npm/jquery@3.3.1/dist/jquery.min.js"></script>

  <script>
    var GOOGLE_CUSTOM_SEARCH_API_KEY = "";
    var GOOGLE_CUSTOM_SEARCH_ENGINE_ID = "";
    var ALGOLIA_API_KEY = "";
    var ALGOLIA_APP_ID = "";
    var ALGOLIA_INDEX_NAME = "";
    var AZURE_SERVICE_NAME = "";
    var AZURE_INDEX_NAME = "";
    var AZURE_QUERY_KEY = "";
    var BAIDU_API_ID = "";
    var SEARCH_SERVICE = "hexo" || "hexo";
    var ROOT = "/"||"/";
    if(!ROOT.endsWith('/'))ROOT += '/';
  </script>

<script src="//instant.page/1.2.2" type="module" integrity="sha384-2xV8M5griQmzyiY3CDqh1dn4z3llDVqZDqzjzcY+jCBCk/a5fXJmuZ/40JJAPeoU"></script>




  <script async src="https://cdn.jsdelivr.net/gh/xaoxuu/cdn-busuanzi@2.3/js/busuanzi.pure.mini.js"></script>




  
  
  
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-backstretch/2.0.4/jquery.backstretch.min.js"></script>
    <script type="text/javascript">
      $(function(){
        if ('') {
          $('').backstretch(
          ["/img/background.jpg"],
          {
            duration: "6000",
            fade: "2500"
          });
        } else {
          $.backstretch(
          ["/img/background.jpg"],
          {
            duration: "6000",
            fade: "2500"
          });
        }
      });
    </script>
  











  
<script src="/js/app.js"></script>



  
<script src="/js/search.js"></script>





<!-- 复制 -->
<script src="https://cdn.jsdelivr.net/npm/clipboard@2/dist/clipboard.min.js"></script>
<script>
  let COPY_SUCCESS = "复制成功";
  let COPY_FAILURE = "复制失败";
  /*页面载入完成后，创建复制按钮*/
  !function (e, t, a) {
    /* code */
    var initCopyCode = function(){
      var copyHtml = '';
      copyHtml += '<button class="btn-copy" data-clipboard-snippet="">';
      copyHtml += '  <i class="fa fa-copy"></i><span>复制</span>';
      copyHtml += '</button>';
      $(".highlight .code pre").before(copyHtml);
      var clipboard = new ClipboardJS('.btn-copy', {
        target: function(trigger) {
          return trigger.nextElementSibling;
        }
      });

      clipboard.on('success', function(e) {
        //您可以加入成功提示
        console.info('Action:', e.action);
        console.info('Text:', e.text);
        console.info('Trigger:', e.trigger);
        success_prompt(COPY_SUCCESS);
        e.clearSelection();
      });
      clipboard.on('error', function(e) {
        //您可以加入失败提示
        console.error('Action:', e.action);
        console.error('Trigger:', e.trigger);
        fail_prompt(COPY_FAILURE);
      });
    }
    initCopyCode();

  }(window, document);

  /**
   * 弹出式提示框，默认1.5秒自动消失
   * @param message 提示信息
   * @param style 提示样式，有alert-success、alert-danger、alert-warning、alert-info
   * @param time 消失时间
   */
  var prompt = function (message, style, time)
  {
      style = (style === undefined) ? 'alert-success' : style;
      time = (time === undefined) ? 1500 : time*1000;
      $('<div>')
          .appendTo('body')
          .addClass('alert ' + style)
          .html(message)
          .show()
          .delay(time)
          .fadeOut();
  };

  // 成功提示
  var success_prompt = function(message, time)
  {
      prompt(message, 'alert-success', time);
  };

  // 失败提示
  var fail_prompt = function(message, time)
  {
      prompt(message, 'alert-danger', time);
  };

  // 提醒
  var warning_prompt = function(message, time)
  {
      prompt(message, 'alert-warning', time);
  };

  // 信息提示
  var info_prompt = function(message, time)
  {
      prompt(message, 'alert-info', time);
  };

</script>


<!-- fancybox -->
<script src="https://cdn.jsdelivr.net/gh/fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.js"></script>
<script>
  let LAZY_LOAD_IMAGE = "";
  $(".article-entry").find("fancybox").find("img").each(function () {
      var element = document.createElement("a");
      $(element).attr("data-fancybox", "gallery");
      $(element).attr("href", $(this).attr("src"));
      /* 图片采用懒加载处理时,
       * 一般图片标签内会有个属性名来存放图片的真实地址，比如 data-original,
       * 那么此处将原本的属性名src替换为对应属性名data-original,
       * 修改如下
       */
       if (LAZY_LOAD_IMAGE) {
         $(element).attr("href", $(this).attr("data-original"));
       }
      $(this).wrap(element);
  });
</script>





  <script>setLoadingBarProgress(100);</script>
</body>
</html>
